<template>
    <view class="content">
        <view class="fontSize">解决办法简述</view>
        <view class="uni-textarea">
            <textarea @input="bindTextAreaBlur" placeholder="请输入简述内容,限制140字数以内" />
            </view>
        <button class="mini-btn" type="primary" size="mini" @tap="bindEnter">确认</button>
    </view>
</template>

<script>
import {
    request
} from "../../../comon/js/request.js"
export default {
    data() {
        return {
            id: "",
            sketch: "",
            handle_status: ""
        };
    },
    onLoad(options) {
        this.id = options.id
    },
    methods: {
        bindTextAreaBlur: function (e) {
            this.sketch = e.detail.value
        },
        // 提交未处理信息
        bindEnter() {
            if (this.sketch === "") {
                return uni.showToast({
                    title: '提交失败,请填写处理内容',
                    duration: 2000,
                    icon:"none"
                });
            } else request({
                url: "v1/alarmRecord/handleStatus",
                data: {
                    id: this.id,
                    sketch: this.sketch,
                    handle_status: 1
                }
            }).then(res => {
                if (res.data.errorCode === 0) {
                    uni.showModal({
                        title: res.data.result,
                        showCancel: false,
                        success: function (res) {
                            // if (res.confirm) {
                            //     uni.switchTab({
                            //         url: '../notice'
                            //     })
                            // }
                        }
                    });
                }
            })
        }
    }
};
</script>

<style lang="less">
.content {
    margin-left: 10rpx;
    margin-left: 20rpx;

    .fontSize {
        margin-top: 10rpx;
        font-size: 28rpx;
    }

    .uni-textarea {
        display: flex;
        margin-top: 10rpx;

        textarea {
            width: 700rpx;
            height: 390rpx;
            border: 1rpx solid #797979;
        }
    }

    .mini-btn {
        margin-top: 70rpx;
        margin-left: 450rpx;
        width: 250rpx;
        height: 80rpx;
        line-height: 80rpx;
        background: #169bd5;
    }
}
</style>
